﻿/* ==============================================================================
 * 功能描述：GameController  
 * 
 * 创 建 者：郑镇泉
 * 
 * 创建日期：2016/4/8 23:32:53
 * ==============================================================================*/
using UnityEngine;
using System.Collections;
using ZZQFrameWork;

public class GameController : MonoBehaviour
{
    private Map map;

    public Map Map
    {
        get { 
            if(map==null)
            {
                GameObject go = GameObject.Find("MapManager");
                if (go == null)
                {
                    go = Instantiate(ResManager.Instance.Load("MapManager") as GameObject);
                }
                map = go.GetOrAddComponent<Map>();
            }
            return map;
        }
    }

    void Awake()
    {
        ModuleManager.Instance.RegisterAllModule();
    }

    void Start()
    {
        Map.InitMap(1);
        UIManager.Instance.OpenUI(Enum_UIOpenType.OpenSelf, Enum_UIType.MainPanel);
        TaskManager.Instance.InitTask();
    }

    #region 测试

    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            UIManager.Instance.ShowHUD(Vector3.up*200, "123", 3);
        }
    }

    #endregion

}